﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Shared;

namespace DAL
{
    public class CategoryRepository : BaseRepository<ProductCategory>, ICategoryRepository
    {
        public CategoryRepository(IdbContext context) : base(context)
        {
          
        }

        public ICollection<string> GetAllCategories()
        {
            List<string> categoryList = new List<string>();
            foreach (var item in _context.Set<ProductCategory>())
            {
                categoryList.Add(item.Name);
            }
            return categoryList;
        }
    }
}
